const findElement = (arr, testFunc) => {
  for (const num of arr) {
    if (testFunc(num)) {
      return num;
    }
  }
  return undefined;
}